﻿@model Model.Customer
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<!--日期显示js-->
<script src="~/Content/js/showdate.js"></script>
<!--省市县js-->
<script src="~/Content/js/js3city.js"></script>
<script src="~/Content/js/jquery-1.8.2.min.js"></script>
<div class="user-order-box">
    <div class="user-order">
        <div class="home-location-box">
            <div class="goods-location">
                <i><img src=" ~/Content/images/icon/home.png" alt="" width="18" height="18"></i>
                <span><a href="">首页</a></span>
                <span>></span>
                <span><a href="">订单管理</a></span>

            </div>


        </div>

        <div class="user-order-main">
            <!--个人中心左侧栏目-->
            <div class="home-box-left">
                <ul>
                    <h3><i><img src=" ~/Content/images/icon/user-products.png" width="18" alt="18"></i>&nbsp;订单中心</h3>
                    <li><a href="~/Shopping/Index">我的购物车</a></li>
                    <li><a href="~/Order/Index1">订单管理</a></li>

                </ul>

                <ul>
                    <h3><i><img src=" ~/Content/images/icon/us.png" width="18" alt="18"></i>&nbsp;会员中心</h3>


                    <li><a href="~/User/Index">个人信息</a></li>

                    <li><a href="~/Address/Index">收货地址</a></li>

                </ul>



            </div>
            <!--个人中心左侧栏目end!-->
            <div class="user-order-manager">
                <!--通用DIV-->
                <div class="order-manager-title">
                    <a href="">个人基本信息</a>
                </div>
                <!--通用DIV end-->
                <input type="hidden" id="custid" name="Id" value="@Model.Id" />
                <div class="user-info-main">
                    <!--修改昵称-->
                    <div class="user-info-info">
                        <table border="0" cellpadding="0" cellspacing="0" width="900">
                            <tr>
                                <td height="55" width="100" align="right">修改昵称：</td>
                                <td width="500"><input type="text" name="CustName" id="CustName" class="info-text" value="@Model.CustName"></td>
                            </tr>
                        </table>

                    </div>
                    <!--性别-->
                    <div class="user-info-info">
                        <table border="0" cellpadding="0" cellspacing="0" width="900">
                            <tr>
                                <td height="55" width="100" align="right">性别：</td>
                                <td width="500" align="left">
                                    @if (Model.Sex == "男")
                                    {
                                        <label><input type="radio" name="Sex" value="保密"> 保密</label>
                                        <label><input type="radio" name="Sex" value="男" checked="checked"> 男</label>
                                        <label><input type="radio" name="Sex" value="女" > 女</label>
                                    }
                                    else if (Model.Sex == "女")
                                    {
                                        <label><input type="radio" name="Sex" value="保密"> 保密</label>
                                        <label><input type="radio" name="Sex" value="男"> 男</label>
                                        <label><input type="radio" name="Sex" value="女" checked="checked"> 女</label>
                                    }
                                    else if (Model.Sex == "保密")
                                    {
                                        <label><input type="radio" name="Sex" value="保密" checked="checked"> 保密</label>
                                        <label><input type="radio" name="Sex" value="男"> 男</label>
                                        <label><input type="radio" name="Sex" value="女"> 女</label>
                                    }


                                </td>
                            </tr>
                        </table>

                    </div>

                    <!--我的生日-->
                    <div class="user-info-info">
                        <table border="0" cellpadding="0" cellspacing="0" width="900">
                            <tr>
                                <td height="55" width="100" align="right">我的生日：</td>
                                <td width="500"><input type="text" id="time" name="Birthday" class="info-text" value="@Model.Birthday" onClick="return Calendar('time');" autocomplete="off"></td>
                            </tr>
                        </table>

                    </div>

                    <!--我的QQ-->
                    <div class="user-info-info">
                        <table border="0" cellpadding="0" cellspacing="0" width="900">
                            <tr>
                                <td height="55" width="100" align="right">我的电话：</td>
                                <td width="500"><input type="text" name="Phone" id="Phone" value="@Model.Phone" class="info-text"></td>

                            </tr>
                        </table>

                    </div>
                    <!--所在地区end!-->
                    <div class="user-info-edit"><input type="button" value="保存修改" id="btn" name="" class="info-edit-btn"></div>
                </div>
            </div>

        </div>



    </div>

</div>

<script>
    $("#btn").click(function () {
        var Sex = $("input[name='Sex']:checked").val();
        $.post("/User/Update", { Id: $("#custid").val(), CustName: $("#CustName").val(), Birthday: $("#time").val(), Phone: $("#Phone").val(), Sex: Sex }, function (res) {
            if (res.Success) {
                alert(res.Message)
                window.location.href = "/User/Index";
            }
        })
    } )


</script>
